<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  
  <title>第 2 页 | Wentao&#39;s Blog</title>

  
  <meta name="author" content="wentao">
  

  

  

  <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">

  

  <meta property="og:site_name" content="Wentao&#39;s Blog"/>

  
  <meta property="og:image" content="/favicon.ico"/>
  

  <link href="/favicon.ico" rel="icon">
  <link rel="alternate" href="/atom.xml" title="Wentao&#39;s Blog" type="application/atom+xml">
  <link rel="stylesheet" href="/css/style.css" media="screen" type="text/css">
</head>


<body>
<div class="blog">
  <div class="content">

    <header>
  <div class="site-branding">
    <h1 class="site-title">
      <a href="/">Wentao&#39;s Blog</a>
    </h1>
    <p class="site-description"></p>
  </div>
  <nav class="site-navigation">
    <ul>
      
        <li><a href="/">主页</a></li>
      
        <li><a href="/archives">归档</a></li>
      
    </ul>
  </nav>
</header>

    <main class="site-main posts-loop">
    
  <article>

  
    
    <h3 class="article-title"><a href="/2014/01/17/ssh-with-public-key/"><span>SSH利用public key登录</span></a></h3>
    
  

  <div class="article-top-meta">
    <span class="posted-on">
      <a href="/2014/01/17/ssh-with-public-key/" rel="bookmark">
        <time class="entry-date published" datetime="2014-01-17T08:42:00.000Z">
          2014-01-17
        </time>
      </a>
    </span>
  </div>


  

  <div class="article-content">
    <div class="entry">
      
        <p><code>ssh</code>作为是远程管理linux服务器的一个很重要的手段.一般的情况下使用账户和密码可以登录的.但是这种方式不太方便也不太安全.比方如果用<code>rsync</code>同步的时候,如果做成自动的话,每次还要输入密码.这个就不太方便了.这个时候如果可以直接登录多方便.</p>
<p><code>ssh</code>是可以使用密钥登录的.把生成的公钥文件传到服务器上面就可以.</p>
<p><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">ssh-keygen</div><div class="line">ssh-copy-id -i ~/.ssh/id_rsa.pub  root@192.168.1.100</div></pre></td></tr></table></figure></p>
<p>如果没有<code>ssh-copy-id</code>的话,需要用下面的命令来手动执行了.
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">ssh root@192.168.1.100 <span class="string">"mkdir .ssh;chmod 0700 .ssh"</span>  (需要输入密码)</div><div class="line">scp ~/.ssh/id_rsa.pub root@192.168.1.100:.ssh/id_rsa.pub  (需要输入密码)</div></pre></td></tr></table></figure></p>
<p>以上就可以完成使用密钥的方式远程登录了.不过如果生成的时候没有指定用id_rsa的话,则需要在登录的时候指定具体使用那个密钥.</p>

      
    </div>

  </div>

  <div class="article-footer">
    <div class="article-meta pull-left">

    
      

    <span class="post-categories">
      <i class="icon-categories"></i>
        <a href="/categories/Dev/">Dev</a>
    </span>
    

    
    

    <span class="post-tags">
      <i class="icon-tags"></i>
        <a href="/tags/linux/">linux</a>
    </span>
    

    </div>

    
    <div class="article-meta pull-right">
      <span>
        <i class="icon-comments"></i>
        <span>
          <a href="http://wentao.org/2014/01/17/ssh-with-public-key/#comment">评论</a>
        </span>
      </span>
    </div>
    
  </div>
</article>



  <article>

  
    
    <h3 class="article-title"><a href="/2013/12/28/maven/"><span>折腾Maven</span></a></h3>
    
  

  <div class="article-top-meta">
    <span class="posted-on">
      <a href="/2013/12/28/maven/" rel="bookmark">
        <time class="entry-date published" datetime="2013-12-28T06:30:00.000Z">
          2013-12-28
        </time>
      </a>
    </span>
  </div>


  

  <div class="article-content">
    <div class="entry">
      
        <p>继前些日子折腾<code>node.js</code>之后.现在又开始搞<code>java</code>了.只能说世事无常了.</p>

      
    </div>

  </div>

  <div class="article-footer">
    <div class="article-meta pull-left">

    
      

    <span class="post-categories">
      <i class="icon-categories"></i>
        <a href="/categories/Dev/">Dev</a>
    </span>
    

    
    

    <span class="post-tags">
      <i class="icon-tags"></i>
        <a href="/tags/maven/">maven</a>
    </span>
    

    </div>

    
    <div class="article-meta pull-right">
      <span>
        <i class="icon-comments"></i>
        <span>
          <a href="http://wentao.org/2013/12/28/maven/#comment">评论</a>
        </span>
      </span>
    </div>
    
  </div>
</article>



  <article>

  
    
    <h3 class="article-title"><a href="/2013/11/26/nodemon-monitor-ahk/"><span>利用NodeMon自动加载AutoHotKey脚本</span></a></h3>
    
  

  <div class="article-top-meta">
    <span class="posted-on">
      <a href="/2013/11/26/nodemon-monitor-ahk/" rel="bookmark">
        <time class="entry-date published" datetime="2013-11-26T13:31:00.000Z">
          2013-11-26
        </time>
      </a>
    </span>
  </div>


  

  <div class="article-content">
    <div class="entry">
      
        <p>在写<code>autohotkey</code>脚本的时候,遇到的一个比较大的困扰就是每次修改完成以后还要去托盘上刷新一下.最近在开发node.js应用的时候,用到一个利器<code>nodemon</code> 这个神器除了能够监控<code>node.js</code>的程序以外.还可以监控一些脚本语言的.</p>
<pre><code>nodemon --exec &quot;d:\dev\autohotkey\autohotkey.exe&quot; d:\dev\script\test.ahk -e ahk
</code></pre>
<p>这样一来,如果修改了test.ahk.会自动退出之前的.然后重新启动一个.也算起到了刷新的作用.</p>

      
    </div>

  </div>

  <div class="article-footer">
    <div class="article-meta pull-left">

    
      

    <span class="post-categories">
      <i class="icon-categories"></i>
        <a href="/categories/Dev/">Dev</a>
    </span>
    

    
    

    <span class="post-tags">
      <i class="icon-tags"></i>
        <a href="/tags/ahk/">ahk</a>
    </span>
    

    </div>

    
    <div class="article-meta pull-right">
      <span>
        <i class="icon-comments"></i>
        <span>
          <a href="http://wentao.org/2013/11/26/nodemon-monitor-ahk/#comment">评论</a>
        </span>
      </span>
    </div>
    
  </div>
</article>



  <article>

  
    
    <h3 class="article-title"><a href="/2013/11/26/change-home/"><span>搬家</span></a></h3>
    
  

  <div class="article-top-meta">
    <span class="posted-on">
      <a href="/2013/11/26/change-home/" rel="bookmark">
        <time class="entry-date published" datetime="2013-11-26T13:28:00.000Z">
          2013-11-26
        </time>
      </a>
    </span>
  </div>


  

  <div class="article-content">
    <div class="entry">
      
        <p>这是来北京之后的第三次搬家了,越来越离北京城远了.搬家是件痛苦的事情,会突然发现,自己多出来好多平时根本没有用到的东西,或者是N久没有穿过的衣服.要考虑这些东西如何处置,再就是那些零零碎碎的东西,害怕丢掉什么.</p>
<p>以后上下班话费的时间,要比之前多上十几分钟,还在可以承受的范围以内.不过,坐公交的话,可以看看书了.晚上的八通线太拥挤了,以至于没法在车上看书,公交还是稍微好点的.</p>

      
    </div>

  </div>

  <div class="article-footer">
    <div class="article-meta pull-left">

    
      

    <span class="post-categories">
      <i class="icon-categories"></i>
        <a href="/categories/Life/">Life</a>
    </span>
    

    
    

    <span class="post-tags">
      <i class="icon-tags"></i>
        <a href="/tags/beijing/">beijing</a>
    </span>
    

    </div>

    
    <div class="article-meta pull-right">
      <span>
        <i class="icon-comments"></i>
        <span>
          <a href="http://wentao.org/2013/11/26/change-home/#comment">评论</a>
        </span>
      </span>
    </div>
    
  </div>
</article>



  <article>

  
    
    <h3 class="article-title"><a href="/2013/11/20/Jiajia-backup/"><span>拼音加加配置备份和同步</span></a></h3>
    
  

  <div class="article-top-meta">
    <span class="posted-on">
      <a href="/2013/11/20/Jiajia-backup/" rel="bookmark">
        <time class="entry-date published" datetime="2013-11-20T12:05:01.000Z">
          2013-11-20
        </time>
      </a>
    </span>
  </div>


  

  <div class="article-content">
    <div class="entry">
      
        <h3>拼音加加输入法</h3>
<p>拼音加加是一个挺好的输入法,虽然作者一直不更新输入法,虽然在windows8上不能算是一个全功能的输入法.但是好用...</p>
<h4>优点</h4>
<ul>
<li>对双拼的良好支持</li>
<li>辅助码不奇特,有些输入法的辅助码奇特的一塌糊涂.加加的辅助码基本没有重新记忆过.</li>
<li>使用的时间长,词库已经很符合自己的习惯了.</li>
<li>词库可以支持很大的,有几百万的词库可选.</li>
<li>神奇的命令直达</li>
</ul>
<h4>缺点</h4>
<ul>
<li>不能在多台机器间同步</li>
<li>不支持微软最新的输入法框架,导致在winodws8上面不能在<code>Metro</code>界面上使用.</li>
</ul>
<h3>加加同步的方案</h3>
<p>加加论坛上面有一个同步的解决办法.使用的是<code>批处理</code>的方式.但是那个分的太细了.自己也用不了那么多.平时就是需要把词库同步,整个输入法目录同步的机会估计很少.<code>bat</code>这东东自己也不熟悉.最后用了<code>AutoHotKey</code>做了一个替代的方案.</p>
<pre><code>:::ahk
EnvGet, syncDir, sync
EnvGet, softDir, soft
EnvGet, uprofile, userprofile
if syncDir =
    MsgBox,没有配置同步盘的环境变量.
if softDir =
    MsgBox,没有配置软件的环境变量

vtype =ciku
if 0 &gt;= 1
{
 vtype = %1%
}
if vtype = ciku
{
	
	FileCopyDir, %uprofile%\appdata\locallow\jjbxb, %syncDir%\Nuts\backup\jjbxb\save, 1
	FileRemoveDir, %syncDir%\Nuts\backup\jjbxb\save\tmp,1
	MsgBox,备份到网盘成功
}else if vtype = all
{
	FileCopyDir, %softDir%\jjbxb, %syncDir%\Nuts\backup\jjbxb, 1
	FileCopyDir, %uprofile%\appdata\locallow\jjbxb, %syncDir%\Nuts\backup\jjbxb\save, 1
	FileRemoveDir, %syncDir%\Nuts\backup\jjbxb\save\tmp,1
	MsgBox,全部备份成功
}
else if vtype = rall
{
	FileCopyDir, %syncDir%\Nuts\backup\jjbxb, %softDir%\jjbxb, 1
	FileCopyDir, %syncDir%\Nuts\backup\jjbxb\save, %uprofile%\appdata\locallow\jjbxb, 1
	MsgBox,全部恢复成功
}
else if vtype = rciku
{
	FileCopyDir, %syncDir%\Nuts\backup\jjbxb\save,%uprofile%\appdata\locallow\jjbxb 1
	MsgBox,从网盘恢复成功
}
</code></pre>
<p>其中用到了两个环境变量,<code>soft</code>是自己常用软件的存放位置.<code>sync</code>是同步网盘存放的位置.需要在环境变量里面提前设置一下.AHK的去参数的地方还是挺好玩的...</p>
<p><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">Scripts support command line parameters. The format is:</div><div class="line"></div><div class="line">AutoHotkey.exe [Switches] [Script Filename] [Script Parameters]</div><div class="line">And for compiled scripts, the format is:</div><div class="line"></div><div class="line">CompiledScript.exe [Switches] [Script Parameters]</div></pre></td></tr></table></figure></p>
<p>参数的信息使用数字获得,<code>0</code>表示参数的个数.从<code>1</code>开始代表参数的内容了.
<figure class="highlight autohotkey"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">if</span> <span class="number">0</span> &lt; <span class="number">3</span>  <span class="comment">; The left side of a non-expression if-statement is always the name of a variable.</span></div><div class="line">&#123;</div><div class="line">    MsgBox This script requires at least <span class="number">3</span> incoming parameters but it only received <span class="variable">%0%</span>.</div><div class="line">    ExitApp</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>ahk的语法还是真实很奇特.autoit这方面就好多了.</p>
<p>网盘使用了<a href="https://jianguoyun.com/%E2%80%8E" target="_blank" rel="external">坚果云</a>.原因就是增量同步,且客户端不想百度和腾讯那么搞的花里胡哨的.我就需要他静静的同步文件就可以了...</p>
<h4>配置加加</h4>
<p>在加加的自定义编码库中加入如下的信息
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line">;测试备份功能</div><div class="line">bfsj=/*$X[备份词库]</div><div class="line">.\sync.ahk</div><div class="line">ciku*/</div><div class="line">bfsj=/*$X[恢复词库]</div><div class="line">.\sync.ahk</div><div class="line">rciku*/</div><div class="line">bfsj=/*$X[备份整个加加]</div><div class="line">.\sync.ahk</div><div class="line">all*/</div><div class="line">bfsj=/*$X[恢复整个加加]</div><div class="line">.\sync.ahk</div><div class="line">rall*/</div></pre></td></tr></table></figure></p>
<h4>注意事项</h4>
<ul>
<li>ahk编译成exe以后,会被某些杀毒软件爆毒.请自觉加入到忽略列表.</li>
</ul>

      
    </div>

  </div>

  <div class="article-footer">
    <div class="article-meta pull-left">

    
      

    <span class="post-categories">
      <i class="icon-categories"></i>
        <a href="/categories/Dev/">Dev</a>
    </span>
    

    
    

    <span class="post-tags">
      <i class="icon-tags"></i>
        <a href="/tags/AHK-Soft/">AHK,Soft</a>
    </span>
    

    </div>

    
    <div class="article-meta pull-right">
      <span>
        <i class="icon-comments"></i>
        <span>
          <a href="http://wentao.org/2013/11/20/Jiajia-backup/#comment">评论</a>
        </span>
      </span>
    </div>
    
  </div>
</article>




<nav class="pagination">
  
  <a href="/" class="pagination-prev">上一页</a>
  
  
  <a href="/page/3/" class="pagination-next">下一页</a>
  
</nav>
    </main>

    <footer class="site-footer">
  <p class="site-info">
    Proudly powered by <a href="https://hexo.io/" target="_blank">Hexo</a> and
    Theme by <a href="https://github.com/CodeDaraW/Hacker" target="_blank">Hacker</a>
    </br>
    
    &copy; 2016 wentao
    
  </p>
</footer>
    
  </div>
</div>
</body>
</html>